package com.xjscrm.common.enums;

/**
 * 会员行为日志
 * @author liuqi
 * @date 2021/8/27 17:19
 * @param
 * @return null
 */
public enum CustomerBehaviorTypeEnum {
    CUSTOMER_REGISTER(0,"注册添加"),
    CUSTOMER_UPDATE_REMARK(1,"修改备注"),
    CUSTOMER_UPDATE_USERNAME(2,"修改称呼"),

    CUSTOMER_ADD_REMARK(3,"新增备注"),

    CUSTOMER_ADD_USERNAME(4,"新增称呼"),

    CUSTOMER_ADD_MOBILE(5,"新增电话"),

    CUSTOMER_UPDATE_MOBILE(6,"修改电话"),

    CUSTOMER_ADD_DESCRIPTION(7,"新增描述"),

    CUSTOMER_UPDATE_DESCRIPTION(8,"修改描述")


    ;

    private Integer value;
    private String desc;

    public static final int CUSTOMER_REGISTER_VALUE = 0;
    public static final int CUSTOMER_UPDATE_REMARK_VALUE = 1;
    public static final int CUSTOMER_UPDATE_USERNAME_VALUE = 2;


    CustomerBehaviorTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }


    public static CustomerBehaviorTypeEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (CustomerBehaviorTypeEnum type: CustomerBehaviorTypeEnum.values()) {
            if (type.getValue().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
